// ---------------------------------------------------
// Rich Text Editor Writte
// Design by. Devy Indriyani
// Input: JavaScript-jQuery
// Published On March 08, 2015
// Visit: http://sahabatblogger77.blogspot.com
//----------------------------------------------------
document.write('<a title="Design By. SAHABAT BLOGGER 77" style="display:block!important;visibility:visible!important;opacity:1!important;position:absolute;bottom:8px;right:5px;font:normal bold 9px Arial,Sans-Serif!important;color:#39f;" href="http://sahabatblogger77.blogspot.com" target="_blank">&#9658; SB-77 Design</a>');
function makeBold() {
  document.execCommand( "bold" );
  if ( document.getElementById( "bold" ).isToggled ) {
    document.getElementById( "bold" ).style.backgroundColor = "#00cc55";
    document.getElementById( "bold" ).isToggled = false;
  } else {
    document.getElementById( "bold" ).style.backgroundColor = "#008833";
    document.getElementById( "bold" ).isToggled = true;}
}
function makeItalic() {
  document.execCommand( "italic" );
   if ( document.getElementById( "italic" ).isToggled ) {
    document.getElementById( "italic" ).style.backgroundColor = "#00cc55";
    document.getElementById( "italic" ).isToggled = false;
  } else {
    document.getElementById( "italic" ).style.backgroundColor = "#008833";
    document.getElementById( "italic" ).isToggled = true;}
}
function doUnderline() {
  document.execCommand( "underline" );
   if ( document.getElementById( "underline" ).isToggled ) {
    document.getElementById( "underline" ).style.backgroundColor = "#00cc55";
    document.getElementById( "underline" ).isToggled = false;
  } else {
    document.getElementById( "underline" ).style.backgroundColor = "#008833";
    document.getElementById( "underline" ).isToggled = true;}
}
function doAddImage() {
  var image_url = prompt( "Image URL:" );
  if (image_url != "") {
    document.execCommand( "insertImage", false, image_url);
  } else {
    alert( "You must set a URL!" )}
}
function justifyLeft() {document.execCommand( "justifyLeft" )}
function justifyCenter() {document.execCommand( "justifyCenter" )}
function justifyRight() {document.execCommand( "justifyRight" )}
function doSetTextColor() {
  var text_color = prompt( "CSS Color:" );
  if (text_color != "") {
    document.execCommand( "foreColor", false, text_color);
  } else {
    alert( "You must set a Color!" )}
}